#ifndef PATCHMETHOD_H
#define PATCHMETHOD_H

#include <QWidget>
#include<QLayout>
#include<UI/oneeventframe.h>
#include<QScrollArea>
#include<QListWidgetItem>
#include<Util/cstate.h>
#include<QDialog>
#include<QMap>
#include<Util/dccinfo.h>
#include<QGroupBox>
#include<QDesktopWidget>
#include<QApplication>
#include<QScrollArea>
#include<QGraphicsView>
#include<Scene/mscene.h>
#include<Util/mdlinfo.h>
#include<Util/CMethodsInfo.h>
/**
 *
 * @brief The PatchMethod class主要是配置数据转换的主界面，汇总各个event的转换方法的配置信息等等
 */
class PatchMethod : public QDialog
{
    Q_OBJECT
public:
    explicit PatchMethod(QMap<QListWidgetItem *, MdlInfo *> *MdlInfoMap, QDialog *parent= 0);
    void initUI(QList<CState *> * CurrentStateList);
    void ShowCustomScene(QListWidgetItem *item);





    void setMethod(QString EventName, QString MethodFilePath, QString DataRelativePath);
signals:
    void SendDCCInfo(QMap<int,DCCInfo *> *);

public slots:
     void on_confirm_clicked();
     void on_cancle_clicked();

private:
    QMap<int,DCCInfo *> *DCCInfoMap;

    QHBoxLayout *MainLayout; //主布局
    QScrollArea *scrollArea;
    QRect clientRect;
    QMap<int,oneEventFrame *> *eventMap;
    QPushButton *ConfirmButton;
    QPushButton *CancelButton;
    QList<CMethodsInfo *> *mConversionMethods;
    get_setInfo *mGet_setInfo;
    QString mDirPath;
    QScrollArea *ViewScrollArea;
    mScene *scene;
    QMap<QListWidgetItem *,MdlInfo *> *MdlInfoMap; //MdlInfoMap
    QMap<QString,QList<oneEventFrame *>*> *mStateMapList;
    QList<oneEventFrame *> *OneEventList;

    bool readConversionMethods();
    static QPointF getXY(int X, int Y, int XLength, bool &LeftToRight);
private slots:
    void StateChange(CState *CurrentState);

};

#endif // PATCHMETHOD_H
